$(function () {
    let res = myAjax("/back/a", {}, "get");
    if (res.msg == 'noLogin') {
        // layer.msg('你还未登录', {icon: 5}, function () {
        location.href = '/login.html';
        // });
    }
});

function myAjax(url, data, type) {
    let result = null;
    $.ajax({
        url: url,
        data: data,
        dataType: 'json',
        type: type,
        async: false,//异步，默认异步，
        success: function (res) {
            console.log(res);

            result = res;
        }
    })
    return result;
}

